package com.wenhao.leetcode.medium;

import java.time.chrono.IsoChronology;
import java.util.LinkedList;

/**
 * @author Wenhao Tong
 * @date 2021/7/17 下午11:47
 */
public class LeetCode456 {
    public static void main(String[] args) {

    }
    public boolean find132pattern(int[] nums) {
        LinkedList<Integer> stack = new LinkedList<>();
        for (int i = 0;i < nums.length;i++) {
            while (stack.size() > 0 && nums[i] < stack.peek()) {
                stack.pop();
            }
        }
        if (stack.size() == 0) {
            return false;
        }
        return true;
    }
}
